﻿<%@ Page Language="C#" MasterPageFile="~/Teacher/TeacMasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Teacher_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentBody" Runat="Server">
<style type="text/css">
#title{
    font-size:25px;
    text-align:center;
}
</style>
    <div id="title">系统公告</div>
    <asp:DataGrid ID="news" runat="server" DataSourceID="SqlDataSource1" CellPadding="4" GridLines="Horizontal"
     AllowSorting="True" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" 
     ShowFooter="True" AutoGenerateColumns="false"   >
        <FooterStyle BackColor="White" ForeColor="#333333" />
        <SelectedItemStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" Mode="NumericPages" />
        <ItemStyle BackColor="White" ForeColor="#333333" />
        <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:BoundColumn HeaderText ="ID" DataField="id" />
            <asp:HyperLinkColumn HeaderText ="标题" DataTextField="title" DataNavigateUrlField ="id" DataNavigateUrlFormatString="../Common/ShowNews.aspx?id={0}" Target="_blank"/>
            <asp:BoundColumn HeaderText="发布人" DataField="publisher" />
            <asp:BoundColumn HeaderText="发布日期" DataField ="date" />
        </Columns>
    </asp:DataGrid>
    
    <asp:SqlDataSource
        ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:onlineexamConnectionStringForNews %>"
        SelectCommand="SELECT * FROM [t_news]">
    </asp:SqlDataSource>
    
</asp:Content>

